package com.redstar.rabbitmq_springboot;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @Author: lihongixng
 * @Description: 消费者
 * @Date: 2019/12/28 15:05
 * @Email：
 */
@Component
public class Coumser1 {

    /**
     * 处理消息的方法
     * @param msg 消息类型，要和发送者保持一致
     */
    @RabbitHandler
    @RabbitListener(queues = "myqueue")
    public void messageHandler (String msg){
        System.out.println(msg);
    }
}
